/* You can add global styles to this file, and also import other style files */

@import '../node_modules/spring-flo/dist/flo.css';
@import 'app/flo/shared/flo.scss';
@import '../node_modules/tippy.js/dist/tippy.css';

h1 {
  margin-top: 0;
}

.datagrid-action-bar {
  margin-top: .6rem;
}

.key-value-wrapper {

  .clr-input-wrapper, .clr-input {
    max-height: none;
    height: auto;
    border-bottom: 0 none;
    padding: 0;
  }

  .clr-input {
    display: block;
  }

  clr-control-helper {
    pre {
      display: inline-block;
      margin: 0.1rem 0;
      padding: 0.2rem;

      code {
        border: 0 none;
        padding: 0;
        border-radius: 0;
      }
    }

    code {
      border: 1px solid var(--clr-color-neutral-400, #cccccc);
      border-radius: 2px;
      padding: 0 .2rem;
    }
  }

  .clr-error {
    code {
      border: 1px solid var(--clr-color-danger-300, #c21d00);
      border-radius: 2px;
      padding: 0 .2rem;
    }
  }
}

.key-value-wrapper {
  clr-icon {
    vertical-align: top;
  }
}

.clr-log {
  padding: 1rem 0;

  pre {
    overflow: scroll;
    background: var(--clr-header-6-bg-color, #00364d);
    padding: 1rem;
    color: var(--clr-header-title-color, #fafafa);
    border: 0 none;
    margin: 0;
  }
}

.logo {
  height: 30px;
  width: 42px;
  color: white;
  margin-right: 16px;
}

.toast-container {
  pointer-events: none;
  position: fixed;
  z-index: 999999;
  top: 82px;
  right: 12px;
}

.branding {
  width: 240px;
}

.datagrid-row .datagrid-row-sticky {
  div.datagrid-cell + div.datagrid-cell {
    position: relative;

    &:after {
      content: ' ';
      width: 1px;
      position: absolute;
      right: 0;
      top: 4px;
      bottom: 6px;
      height: auto;
      background-color: var(--clr-table-border-color, #cccccc);
    }

    &:before {
      content: ' ';
      width: 1px;
      position: absolute;
      left: 0;
      top: 4px;
      height: 30px;
      background-color: var(--clr-table-border-color, #cccccc);
    }
  }
}

a:link, a:visited {
  color: #0072a3;
  color: var(--clr-link-color, #0072a3);
}

.label-uppercase {
  text-transform: uppercase;
}

.stream-flo-view, .task-flo-view {
  height: 300px;
  overflow: hidden;

  #paper {
    overflow: hidden !important;
    background-color: transparent;

    &:focus, &:active {
      border: 0 none;
      outline: none;
      margin: 0;
      padding: 0;
    }
  }

  #paper-container {
    background-color: transparent;
  }

  .canvas {
    border: 0 none;
    margin: 0;
  }

  .flow-view {
    height: 300px;
    overflow: hidden;
  }
}

.datagrid-row-detail {
  border-top: 1px dashed var(--clr-table-border-color, #cccccc);
  padding: 0;
  margin: 0 .4rem;
}

.clr-detail-flo {
  display: block;
  height: 300px;
  width: 100%;
}

.dsl-text {
  background: var(--clr-label-info-bg-color, #e3f5fc);
  color: var(--clr-label-info-font-color, #00567a);
  padding: .3rem .5rem;
  border-radius: 3px;
  display: inline-block;
  line-height: .6rem;
  margin-top: -3px;
}

.dsl-truncate {
  max-width: 100%;
  overflow: hidden;
  height: 26px;
  white-space: nowrap;
  line-height: 22px;
  padding: 0.1rem 0.5rem;
  text-overflow: ellipsis;
}

.text-truncate {
  max-width: 100%;
  overflow: hidden;
  height: 24px;
  white-space: nowrap;
  line-height: 19px;
  padding: 0;
  text-overflow: ellipsis;
  display: inline-block;
}

.datagrid-scrolling-cells {
  height: 42px;
}

.clr-datagrid-no-fixed-height {
  .datagrid-scrolling-cells {
    height: auto;
  }
}

.clr-accordion-content {
  background-color: var(--clr-global-app-background, #fafafa);
  border-color: var(--clr-accordion-border-color, #cccccc);
}

.modal-fixed {
  .modal {
    justify-content: start;
  }
}

.card-block-keyvalue {
  .row {
    padding: .2rem 0;
    display: flex;

    .key {
      min-width: 120px;
      max-width: 120px;
      font-weight: bold;
    }

    .value {
      word-break: break-all;
    }
  }

  &.lg-key {
    .key {
      min-width: 220px;
      max-width: 220px;
      font-weight: bold;
    }
  }

  .list-item {
    padding: .4rem 0;
    border-bottom: 1px solid var(--clr-card-border-color, #dedede);

    &:last-child {
      border-bottom: 0 none;
    }

    h4 {
      padding: .2rem 0;
      margin: 0;
      font-size: 15px;
    }
  }
}

.dataflow-card {
  .card-header {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;

    a {
      text-decoration: none;
    }

    .icon {
      transition: transform .15s;
      transform: rotate(90deg);
    }
  }

  &.active {
    .card-header {
      .icon {
        transform: rotate(180deg);
      }
    }
  }
}

.clr-vertical-nav-bottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
}

.register-item, .register-item-empty {
  border: 1px solid var(--clr-card-border-color, #dedede);
  padding: 0 1rem 1rem 1rem;
  margin: 2rem 0 0 0;
}

.register-item-empty {
  text-align: center;
  min-height: 150px;
  align-items: center;
  display: flex;

  .btn {
    margin: 0 auto;
  }
}

.clr-accordion-footer {
  padding: 1rem 0;
}

.clr-file-input-wrapper {
  input {
    display: none;
  }

  label {
    display: inline-block;
    border-bottom: 1px solid var(--clr-forms-border-color, #b3b3b3);
    padding-bottom: 1px;
  }

  span.filename {
    display: inline-block;
    vertical-align: middle;
    width: 200px;

    .text-truncate {
      height: 22px;
    }
  }

  span.btn {
    display: inline-block;
    margin: 0;
    vertical-align: top;
  }
}

.title-select {
  padding-top: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--clr-forms-border-color, #b3b3b3);
}

.link {
  color: var(--clr-link-color, #0072a3);
  cursor: pointer;
}

.signpost {
  .signpost-about {
    min-width: 600px;
    max-width: 600px;
    min-height: 350px;
    max-height: 350px;
    color: white;

    ul, ul a, h3 {
      color: white;
    }

    p {
      color: rgba(white, .6);
      padding: .5rem 0;
      margin: 0;
      font-size: 13px;
    }

    h3 {
      font-weight: bold;
    }

    ul {
      margin-left: .4rem;
    }

    .signpost-wrap {
      color: white;
      background-image: url('');
      background-repeat: no-repeat;
      background-size: 600px 380px;
      background-position: right -30px;
      min-height: 350px;
      max-height: 350px;
      border: 0 none;
      box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    }

    .signpost-content-header {
      background: none;
    }

    &.bottom-left .popover-pointer {
      border-bottom: 0 none;
      //border-top: 1rem solid transparent;
      top: -1rem;
    }

    &.bottom-left .popover-pointer:before {
      border-bottom: 1rem solid #7848ad;
      border-left: 1rem solid transparent;
    }

    .btn.btn-primary {
      background: transparent;
      color: white;
      border-color: rgba(white, .7);

      &:hover {
        background: rgba(white, .05);
        border-color: white;
      }
    }

    .signpost-action {
      margin: 0.8rem;

      clr-icon {
        fill: rgba(white, .7);
        height: 1.2rem;
        width: 1.2rem;
      }

      &:hover {
        clr-icon {
          fill: white;
        }
      }
    }
  }
}

.modal-about {
  color: var(--clr-global-font-color, #222222);
  white-space: normal;

  .modal-body {
    padding-left: 4px;

    h3 {
      margin: 0;
      padding: .8rem 0 .4rem;
      font-size: 16px;
      font-weight: bold;
    }
  }
}

.list-status {
  > div {
    display: flex;
    padding: .4rem 0;
    border-bottom: 1px solid var(--clr-forms-border-color, #b3b3b3);

    &:last-child {
      border-bottom: 0;
    }
  }

  span.desc {
    flex: 1 1 500px;
  }

  span.status {
    width: 200px;
  }
}

.header-actions {
  .divider {
    display: inline-block;
    background: #fafafa;
    background: var(--clr-header-font-color, #fafafa);
    opacity: var(--clr-header-divider-opacity, 0.15);
    height: 2rem;
    width: var(--clr-global-borderwidth, 0.05rem);
    margin-top: 0.5rem;
  }
}

// Labels

// App Labels

.label-app {
  text-transform: uppercase;
  border: 0 none;
  $source1: var(--clr-custom-app-label-source-bg-1, #459ace);
  $source2: var(--clr-custom-app-label-source-bg-2, #39afd6);
  $sink1: var(--clr-custom-app-label-sink-bg-1, #dfb13d);
  $sink2: var(--clr-custom-app-label-sink-bg-2, #ef8b42);
  $processor1: var(--clr-custom-app-label-processor-bg-1, #6a9f39);
  $processor2: var(--clr-custom-app-label-processor-bg-2, #519b63);
  $app1: var(--clr-custom-app-label-app-bg-1, #7151d8);
  $app2: var(--clr-custom-app-label-app-bg-2, #9655ce);
  $task1: var(--clr-custom-app-label-task-bg-1, #ce6256);
  $task2: var(--clr-custom-app-label-task-bg-2, #da5897);

  &.source {
    background: $source1;
    background: linear-gradient(90deg, $source1 0%, $source2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.sink {
    background: $sink1;
    background: linear-gradient(90deg, $sink1 0%, $sink2 100%);
    color: var(--clr-custom-app-label-sink-text, white);
  }

  &.processor {
    background: $processor1;
    background: linear-gradient(90deg, $processor1 0%, $processor2 100%);
    color: var(--clr-custom-app-label-processor-text, white);
  }

  &.app {
    background: $app1;
    background: linear-gradient(90deg, $app1 0%, $app2 100%);
    color: var(--clr-custom-app-label-app-text, white);
  }

  &.task {
    background: $task1;
    background: linear-gradient(90deg, $task1 0%, $task2 100%);
    color: var(--clr-custom-app-label-task-text, white);
  }
}

// Label Streams

.label-stream, .label-runtime {
  text-transform: uppercase;
  border: 0 none;
  $deploying1: var(--clr-custom-stream-label-deploying-bg-1, #459ace);
  $deploying2: var(--clr-custom-stream-label-deploying-bg-2, #39afd6);
  $deployed1: var(--clr-custom-stream-label-deployed-bg-1, #6a9f39);
  $deployed2: var(--clr-custom-stream-label-deployed-bg-2, #7a9c22);
  $incomplete1: var(--clr-custom-stream-label-incomplete-bg-1, #dfb13d);
  $incomplete2: var(--clr-custom-stream-label-incomplete-bg-2, #efc359);
  $failed1: var(--clr-custom-stream-label-failed-bg-1, #cb5719);
  $failed2: var(--clr-custom-stream-label-failed-bg-2, #cf2117);
  $undeployed1: var(--clr-custom-stream-label-undeployed-bg-1, #7d7088);
  $undeployed2: var(--clr-custom-stream-label-undeployed-bg-2, #5a5076);

  &.deploying, &.unknown {
    background: $deploying1;
    background: linear-gradient(90deg, $deploying1 0%, $deploying2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.deployed {
    background: $deployed1;
    background: linear-gradient(90deg, $deployed1 0%, $deployed2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.incomplete, &.partial {
    background: $incomplete1;
    background: linear-gradient(90deg, $incomplete1 0%, $incomplete2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.failed {
    background: $failed1;
    background: linear-gradient(90deg, $failed1 0%, $failed2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.undeployed {
    background: $undeployed1;
    background: linear-gradient(90deg, $undeployed1 0%, $undeployed2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }
}

// Label Tasks
.label-task {
  text-transform: uppercase;
  border: 0 none;
  $unknown1: var(--clr-custom-task-label-unknown-bg-1, #dfb13d);
  $unknown2: var(--clr-custom-task-label-unknown-bg-2, #efc359);
  $complete1: var(--clr-custom-task-label-complete-bg-1, #6a9f39);
  $complete2: var(--clr-custom-task-label-complete-bg-2, #7a9c22);
  $error1: var(--clr-custom-task-label-error-bg-1, #cb5719);
  $error2: var(--clr-custom-task-label-error-bg-2, #cf2117);
  $running1: var(--clr-custom-task-label-running-bg-1, #459ace);
  $running2: var(--clr-custom-task-label-running-bg-2, #39afd6);

  &.unknown {
    background: $unknown1;
    background: linear-gradient(90deg, $unknown1 0%, $unknown2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.complete {
    background: $complete1;
    background: linear-gradient(90deg, $complete1 0%, $complete2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.error {
    background: $error1;
    background: linear-gradient(90deg, $error1 0%, $error2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.running {
    background: $running1;
    background: linear-gradient(90deg, $running1 0%, $running2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }
}

.label-job, .label-execution, .label-exit-code {
  text-transform: uppercase;
  border: 0 none;

  $completed1: var(--clr-custom-execution-label-completed-bg-1, #6a9f39);
  $completed2: var(--clr-custom-execution-label-completed-bg-2, #7a9c22);
  $error1: var(--clr-custom-execution-label-error-bg-1, #cb5719);
  $error2: var(--clr-custom-execution-label-error-bg-2, #cf2117);

  &.completed {
    background: $completed1;
    background: linear-gradient(90deg, $completed1 0%, $completed2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }

  &.error {
    background: $error1;
    background: linear-gradient(90deg, $error1 0%, $error2 100%);
    color: var(--clr-custom-app-label-source-text, white);
  }
}


.label-record-action {
  text-transform: uppercase;
  border: 0 none;
  $label1: var(--clr-custom-record-action-label-running-bg-1, #136bc6);
  $label2: var(--clr-custom-record-action-label-running-bg-2, #1d7ddd);
  background: $label1;
  background: linear-gradient(90deg, $label1 0%, $label2 100%);
  color: var(--clr-custom-app-label-source-text, white);
}

.label-record-operation {

}
